<!--要件配置ss11010 ss02001 ss02005-->
<template>
  <div style="width: 100%;height: 100%;position: absolute">
    <Ss11010Modal :ss12001Id="ss12001Id" :familyId="ss17001Id" style="height: calc(100% - 52px)" :type="17" :processStage="processStage"/>
    <div style="width:100%;text-align: center;margin-top: 20px">
      <Button @click="prevStep">上一步</Button>
      <Button type="primary" @click="nextStep" :loading="btnLoading" style="margin-left:20px">下一步
      </Button>
    </div>
  </div>
</template>

<script>
  import {getAction, postAction} from '@/api/request'
  import {CommonMixin} from '@/views/common/js/CommonMixin'
  import '@/views/common/css/common.css';
  import {getSign, createUpLoadFiles} from '@/api/common'
  import Ss11010Modal from '../ss11_create_steps/modules/Ss11010Modal'


  export default {
    name: "application10",
    mixins: [CommonMixin],
    components: {
      Ss11010Modal
    },
    data() {
      return {
        isDisabled: true,  //是否加载完成要件配置
        btnLoading: false,
        validateCode: true,
        validateMsg: '',
        processStage: '01', //流程阶段数组 如 01,02,03
        expandedCode: '01',   //默认展开，并可上传操作的流程阶段code
        assistanceType: '100', //救助类型
        ss17001Id: this.$parent.familyInfo.ss17001Id,
        ss12001Id: this.$parent.familyInfo.ss12001Id,
        familyInfo: {},
        url: {
          check: "/api/ac/subsistence/ss17010Service/check"
        },
        ssca0016: this.$parent.ssca0016,
      }
    },
    methods: {
      prevStep() {
        this.$emit('prevStep')
      },
      nextStep() {
        this.btnLoading = true;
        let yjab0012 = this.$parent.familyInfo.yjab0012;
        if (yjab0012 == '01' || yjab0012 == '02' || yjab0012 == '04') {
          //预警处置 已处置、维持现状、停救不校验
          this.$emit('nextStep')
          this.btnLoading = false
        } else if (this.$parent.familyInfo.ssca0016 == '500' || this.$parent.familyInfo.ssca0016 == '501') {
          this.$emit('nextStep')
          this.btnLoading = false
        } else {
          let that = this;
          let url = this.url.check;
          postAction(url, {
            processStage: this.processStage,
            familyId: this.ss17001Id,
            ss12001Id: this.ss12001Id,
          }).then((res) => {
            if (res.data.errcode != 0) {
              this.$Message.error(res.data.errmsg);
            } else {
              this.$emit('nextStep');
            }
          }).finally(() => {
            that.btnLoading = false;
          })
        }
      },

    },
    created() {
      let processStage = this.$parent.familyInfo.processstage;
      if (processStage) {
        this.processStage = processStage;
      }
    }
  }
</script>

<style>
  .demo-spin-icon-load {
    animation: ani-demo-spin 1s linear infinite;
  }

  @keyframes ani-demo-spin {
    from {
      transform: rotate(0deg);
    }
    50% {
      transform: rotate(180deg);
    }
    to {
      transform: rotate(360deg);
    }
  }

  .demo-spin-col {
    height: 100px;
    position: relative;
    border: 1px solid #eee;
  }

  .ivu-table .demo-table-info-row td {
    background-color: #2db7f5;
    color: #fff;
  }

  .ivu-table .demo-table-error-row td {
    background-color: #ffffff;
    /*font-color: #fff;*/
    color: #f33e3e;
  }

  .ivu-table td.demo-table-info-column {
    background-color: #2db7f5;
    color: #fff;
  }

  .ivu-table .demo-table-info-cell-name {
    background-color: #2db7f5;
    color: #fff;
  }

  .ivu-table .demo-table-info-cell-age {
    background-color: #ff6600;
    color: #fff;
  }

  .ivu-table .demo-table-info-cell-address {
    background-color: #187;
    color: #fff;
  }
</style>
